#ifndef ITS_H
#define ITS_H

#include <QMap>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QTextCodec>
#include "domainmodel.h"
#include "learnermodel.h"
#include "pedagogicalagent.h"
#include "evaluation.h"

namespace IAlib
{

class IA_LIBSHARED_EXPORT ITS : public QObject
{
    Q_OBJECT

public:

    ITS();
    ITS(const ITS& its);
    ~ITS();

	void init();
    void addDomainModel(const DomainModel& domain_model);
    void removeDomainModel(const QString& role);
    void addLearnerModel(const LearnerModel& learner_model);
    void addEvaluation(const Evaluation& evaluation);

    QMap<QString, DomainModel*>  getDomainModels()  const;
    QMap<QString, LearnerModel*> getLearnerModels() const;
    QMap<QString, Evaluation*>   getEvaluations()   const;

    DomainModel*  getDomainModel(const QString& role);
    LearnerModel* getLearnerModel(const QString& id);
    Evaluation *  getEvaluation(const QString& id);

    void finalEvaluation(const QString id);

    QDomDocument toXML( const QString& file ) const;
    int  fromXML( const QString& file );

    QByteArray toByteArray() const;
    int fromByteArray(QByteArray& array);

    ITS& operator=(const ITS& its);

public Q_SLOTS:

    void on_its_action_emit(const ItsAction& action);

private:

    QMap<QString, DomainModel*>         m_domain_models;
    QMap<QString, LearnerModel*>        m_learner_models;
    QMap<QString, PedagogicalAgent*>    m_pedagogical_agents;
    QMap<QString, Evaluation*>          m_evaluations;

Q_SIGNALS:

    void its_action_added(const IAlib::ItsAction& action);
};


}
#endif // ITS_H
